<%@ page language="java" contentType="text/html; charset=windows-1255" pageEncoding="windows-1255"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>


      <body>
            <f:view>
            <%@include file="../inc/menu.inc" %>
            <f:loadBundle basename="il" var="mes"/>
            <h:outputText style="font-size:30;color:#680000" value="#{mes.menu_refunds}" />
             		    <br>
             		    <br>
            	<a4j:form>
            		<rich:panel>
	            		<h:outputText value="#{mes.refunds_from_date}"/>&nbsp;
	            		<rich:calendar  value="#{refundsManagedBean.fromDate}" />&nbsp;&nbsp;
	            		<h:outputText value="#{mes.refunds_to_date}"/> &nbsp;&nbsp;
	            		<rich:calendar  value="#{refundsManagedBean.toDate}" />
	            		<br>
	            		<br>  
	            		<a4j:commandButton value="#{mes.refunds_get_prds_dates }" action="#{refundsManagedBean.getPrdsBetweenDates}" reRender="prdsFromDpa, updateBtn" />
	            		<br>
	            		<br>
				        	<rich:extendedDataTable id="prdsFromDpa" value="#{refundsManagedBean.prds}" var="prd" width="1000px" height="350px" columnClasses="center"
				        	rows="10" reRender="ds">
				            	<rich:column > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_dpa_id}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.dpa.dpaId}"/>
				            	</rich:column>
								<rich:column > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_prd_id}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.product.dialogicItemKey}"/>
				            	</rich:column>
								<rich:column > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_prd_desc}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.product.productName}"/>
				            	</rich:column> 
								<rich:column > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_sdc}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.sdc}"/>
				            	</rich:column>
				            	<rich:column > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_app_price}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.approvedPrice}"/>
				            	</rich:column>
				            	<rich:column width="160px"> 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_qty_in_dpa}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.quantity}"/>
				            	</rich:column>
				            	<rich:column width="180px" > 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_qty_rep}"/>
				                	</f:facet>
					                <h:outputText value="#{prd.quantityReported}"/>
				            	</rich:column>
				            	<rich:column width="150px"> 
				                	<f:facet name="header">
				                    	<h:outputText value="#{mes.refunds_qty_unpaid}"/>
				                	</f:facet>
				                	<rich:inputNumberSpinner  value = "#{prd.quantityPaid}"  maxValue="#{prd.quantityReported}" minValue="#{prd.quantityPaid}" />
				            	</rich:column>				            				            			            	
				            	
				            	
				                <f:facet name="footer">
					                <rich:datascroller id="ds"></rich:datascroller>
					            </f:facet>
					        </rich:extendedDataTable>
					        
					        <br>
					        <br>
					        <h:commandButton id = "updateBtn" action="#{refundsManagedBean.update}" 
					        	value="#{mes.refunds_update}" disabled="#{refundsManagedBean.canUpdate}" />&nbsp;&nbsp;
					</rich:panel>
				</a4j:form>
            </f:view>
      </body>
      </html>

